package com.joysuch.wwyt.dynamicdata.service;

import com.joysuch.wwyt.core.exception.ApiBusinessException;
import com.joysuch.wwyt.dynamicdata.entity.BaseDynamicBizMapping;
import com.joysuch.wwyt.dynamicdata.entity.BaseDynamicFieldConfig;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.dynamicdata.entity.DropDownSelectBean;
import com.joysuch.wwyt.dynamicdata.entity.vo.BaseDynamicBizVO;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author jwk
 * @since 2021-11-26
 */
public interface BaseDynamicFieldConfigService extends IService<BaseDynamicFieldConfig> {
    /**
     * Find field list biz mapping id
     * @param bizMappingId
     * @return
     */
    List<BaseDynamicFieldConfig> findByBizMappingId(Long bizMappingId);

    /**
     * Find all biz mapping list
     * @return
     */
    List<BaseDynamicBizMapping> findAllBizMapping();

    /**
     * Find field list by biz type
     * @param bizType
     * @return
     */
    List<BaseDynamicFieldConfig> findByBizType(String bizType);

    /**
     * summary list
     * @return
     */
    List<BaseDynamicBizVO> findSummaryList();

    /**
     * get component list
     * @return
     */
    List<DropDownSelectBean> componentTypeList();

    /**
     * batch delete
     * @param configIds
     * @return
     */
    boolean batchDelete(List<Long> configIds);

    /**
     * batch save or update
     * @param dynamicFieldConfigs
     */
    void saveConfigOrUpdateBatch(List<BaseDynamicFieldConfig> dynamicFieldConfigs) throws ApiBusinessException;
}
